package cn.wolfcode.shop.mapper;

import cn.wolfcode.shop.domain.Catalog;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CatalogMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Catalog record);

    Catalog selectByPrimaryKey(Long id);

    List<Catalog> selectAll();

    int updateByPrimaryKey(Catalog record);

    List<Catalog> queryByPId(Long catalogId);

    int queryChildCountByChildId(Long catalogId);

    void updateParentStateByChildId(@Param("catalogId") Long catalogId, @Param("parentState") boolean parentState);

    Catalog getParentByChildId(Long catalogId);

    int queryChildCountById(Long id);
}